package com.whatech.mall.order.feignclient;

import com.whatech.mall.order.model.dto.userservice.UserDTO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * UserServiceFeignClient 的降级处理类。
 */
@Slf4j
@Component
public class UserServiceFeignClientFallback implements UserServiceFeignClient {

    @Override
    public UserDTO findUserById(Long id) {
        log.warn("UserServiceFeignClientFallback.findUserById() is block or fallback.");
        return UserDTO.builder()
                .id(id)
                .build();
    }

    @Override
    public boolean getUser(UserDTO userDTO) {
        log.warn("UserServiceFeignClientFallback.getUser() is block or fallback.");
        return false;
    }

}
